package binaryTree;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import utils.binaryTreeUtil.TreeNode;

public class inorderTraversal {
    
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> list=new ArrayList<>();
        inorder(root, list);
        return list;
    }
    public void inorder(TreeNode root,List<Integer> result){
        if (root==null) {
            return;
        }
        inorder(root.left, result);
        result.add(root.val);
        inorder(root.right, result);
    }
    public static void main(String[] args) {
        
    }
}
